/**
 * 
 */
package com.faxsun.core.service;

import java.util.List;

import com.faxsun.core.persist.entity.FollowListPO;

import mtons.modules.pojos.Page;

/**
 * @author leima
 *
 */
public interface FollowListService {
    
    /**
     * find all followers given a user id or a product id
     * @param page paing number
     * @param uid a user id or a product id
     * @return list of followers at given page index
     */
    List<FollowListPO> findAllMyFollowers(Page page, long uid, int itemType);
    
    /**
     * find all follows given a user id or a product and the corresponding item-type
     * @param page paing number
     * @param followerId a user id or a product id
     * @param itemType 0-user,1-product,2-evaluation,3-news
     * @return list of follows at given page index
     */
    List<FollowListPO> findAllMyFollows(Page page, long followerId, int itemType);
    
    /**
     * find current count of followers
     * @param uid a user id or a product id
     * @param itemType  0-user,1-product,2-evaluation,3-news
     * @return current count of followers
     */
    int countAllMyFollowers(long uid, int itemType);
    
    
    /**
     * find current count of followers
     * @param followerId uid a user id or a product id
     * @param itemType  0-user,1-product,2-evaluation,3-news
     * @return current count of follows
     */
    int countAllMyFollows(long followerId, int itemType);
    
    /**
     * find current count of thumbsup-ers
     * @param uid a product id
     * @param itemType  1-product,2-evaluation,3-news
     * @return current count of thumbsup-ers
     */
    int countAllMyThumbsupers(long uid, int itemType);
    
    /**
     * persist a follow
     * @param fl a FollowListPO
     * @return the saved FollowListPO
     */
    FollowListPO follow(FollowListPO fl);
    
    /**
     * persist a thumbsup
     * @param fl a FollowListPO
     * @return the saved FollowListPO
     */
    FollowListPO thumbsup(FollowListPO fl);
    
    /**
     * persist a thumbsup cancellation
     * @param fl a FollowListPO
     * @return the saved FollowListPO
     */
    FollowListPO thumbsupCancel(FollowListPO fl);
    
    /**
     * persist an unfollow
     * @param fl a FollowListPO to be un-followed
     * @return the saved FollowListPO for unfollow action
     */
    FollowListPO unfollow(FollowListPO fl);
    
    /**
     * Find target FollowListPO by given uid and followerId
     * @param uid the user or product id
     * @param followerId follower id
     * @param itemType  0-user,1-product, 2-evaluation,3-news
     * @return FollowListPO by given uid and followerId
     */
    FollowListPO findFollow(long uid, long followerId, int itemType);
    
}
